package com.example.design.patterns.冰河.创建型模式.建造者.冰河.concreteBuilder;

import com.example.design.patterns.冰河.创建型模式.建造者.冰河.builder.PersonBuilder;
import com.example.design.patterns.冰河.创建型模式.建造者.冰河.product.Man;
import com.example.design.patterns.冰河.创建型模式.建造者.冰河.product.Person;

/**
 * 实现Builder的接口以构造的装配该产品的各个部件
 */
public class ManBuilder implements PersonBuilder {
    Person person;

    public ManBuilder() {
        person = new Man();
    }

    /**
     *
     */
    @Override
    public void buildHead() {
        person.setHead("建造男人头");
    }

    /**
     *
     */
    @Override
    public void buildBody() {
        person.setBody("建造男人身体");
    }

    /**
     *
     */
    @Override
    public void buildFoot() {
        person.setFoot("建造男人足");
    }

    /**
     *
     * @return
     */
    @Override
    public Person buildPersion() {
        return person;
    }
}
